package com.jin.spirng_boot_learn.configure;

import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;

@Configuration
@EnableCaching
public class CacheConfigure {


//    /**
//     * ehcache factory bean.
//     * @return
//     */
//    @Bean
//    public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() {
//        EhCacheManagerFactoryBean bean = new EhCacheManagerFactoryBean();
//        bean.setConfigLocation(new ClassPathResource("ehcache.xml"));
//        bean.setShared(true);
//        return bean;
//    }
//
//    /**
//     * ehcache manager.
//     */
//    @Bean
//    public EhCacheCacheManager ehCacheCacheManager(
//            EhCacheManagerFactoryBean ehCacheManagerFactoryBean) {
//        return new EhCacheCacheManager(ehCacheManagerFactoryBean.getObject());
//    }

}
